<template>
  <check-icon :value.sync="selected">
    <slot></slot>
  </check-icon>
</template>

<script>
import { CheckIcon } from "vux";
export default {
  props: {
    selected: {
      default: false
    },
    index: {
      default: null
    }
  },
  data() {
    return {
      sel: false
    };
  },
  mounted() {
    this.sel = this.selected;
  },
  watch: {
   'selected': function() {
     this.selected = !this.selected
     this.$emit('selectChange', this.selected, this.index)
//     this.sel = this.selected;
   },
    'sel':function(){
      console.log(this.sel,'fffffffffffffff')
//    	console.log(this.sel)
      this.$emit('selectChange', this.sel, this.index)
    }
  },
    methods: {
  	    change(val) {
  	    	console.log(val)
        }
    },
  components: {
    CheckIcon
  }
};
</script>

<style>
.vux-check-icon {
  text-align: center !important;
}
.weui-icon-success {
  color: #7e56c6 !important;
}
.vux-check-icon > .weui-icon-success:before,
.vux-check-icon > .weui-icon-success-circle:before {
  color: #7e56c6 !important;
}
.vux-check-icon {
  width: 0.67rem;
}
.weui-icon-circle {
  font-size: 0.26rem !important;
  color: #c9c9c9;
}
.weui-icon-success {
  font-size: 0.27rem !important;
}
</style>
